package object3D;

import context.*;

import geometry3D.Point3D;

import model2D.Model2D;
import object2D.KanalProjection;

import java.awt.Color;

import javax.media.j3d.Group;
import javax.vecmath.Color3f;

import org.json.JSONException;

// ***************************************************************************
// *** CLASS: Kanal
// ***************************************************************************
public class Kanal extends Block implements Context.Constants
{ //private static final boolean DEBUG=true; // Overriding Context.Constants.DEBUG
    
  public Kanal(String ident,Point3D p0,double width,double height,double depth)
  { super(ident,p0,width,height,depth); }
    
  // ***************************************************************************
  // *** METHOD: getModel3D
  // ***************************************************************************
  public /*abstract*/ Group getModel3D(Color3f c)
  { Group tg=new Group();
    addKanalModel(tg,c);
    return(tg);
  }  

  private void addKanalModel(Group tg,Color3f c)
  {
//    tg.addChild(super.getModel3D(c));  // TEST !!!!    
  }


  // ***************************************************************************
  // *** METHOD: addProjection  (2D)
  // ***************************************************************************
  // 3D ==> 2D projections the XZ, XY or ZY-plane
  public void addProjection(Model2D objectModel,int type,int direction,Color color,float opacity)
  throws JSONException
  { objectModel.addChild(new KanalProjection(objectModel,this,type,direction,color,opacity)); }

}
